<template>
  <div>
    <div>MessageView</div>
    <MyMessage :name="name" title="标题一" @itemclick="itemclickFun" />
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";
// import MyMessage from "@/components/MyMessage.vue";
export default defineComponent({
  name: "MessageView",
  setup() {
    const name = ref("传入子组件的name");
    // 监听子组件抛出的事件
    const itemclickFun = (e: any) => {
      console.log("子组件给的值：", e);
    };
    return { name, itemclickFun };
  },
  // components: { MyMessage },
});
</script>

<style lang="scss" scoped>
</style>
